<% add_decidim_meta_tags(
  description: translated_attribute(current_participatory_space.short_description),
  title: component_name,
  url: proposals_url,
  resource: current_component) %>

<%= append_stylesheet_pack_tag "decidim_proposals", media: "all" %>
<%= append_javascript_pack_tag "decidim_proposals" %>

<% content_for :aside do %>

  <h1 id="drafts-count" class="title-decorator"><%= component_name %></h1>

  <% if current_settings.creation_enabled %>
    <%= action_authorized_link_to :create, new_collaborative_draft_path, permissions_holder: current_component, class: "button button__sm button__transparent-secondary", data: { "redirect_url" => new_collaborative_draft_path } do %>
      <span><%= t("new_collaborative_draft", scope: "decidim.proposals.collaborative_drafts.new_collaborative_draft_button") %></span>
      <%= icon "add-line" %>
    <% end %>
  <% end %>

  <%= render layout: "decidim/shared/filters", locals: { filter_sections: collaborative_drafts_filter_sections, search_variable: :search_text_cont, skip_to_id: "collaborative_drafts" } do %>
    <%= hidden_field_tag :order, order, id: nil, class: "order_filter" %>
  <% end %>

<% end %>

<%= render layout: "layouts/decidim/shared/layout_two_col" do %>

  <%= render partial: "decidim/shared/component_announcement" %>

  <section id="collaborative_drafts" class="layout-main__section layout-main__heading">
    <%= render partial: "collaborative_drafts" %>
  </section>

<% end %>
